
<template>
  <el-dialog
    title="查看图片"
    :width="'500px'"
    :close-on-click-modal="false"
    :modal="false"
    :visible.sync="dialogData.dialogVisible"
  >
    <img style="display: block; max-width: 400px; margin: 0 auto;" :src="imgUrl" />
  </el-dialog>
</template>
<script>
const VUE_APP_FILE = process.env.VUE_APP_FILE

export default {
  name: 'read-img',
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialogVisible: false,
          value: '',
          id: ''
        }
      }
    }
  },
  computed: {
    imgUrl() {
      if (
        this.dialogData.value !== null &&
        this.dialogData.value !== undefined &&
        this.dialogData.value !== ''
      ) {
        return VUE_APP_FILE + this.dialogData.value
      }
    }
  }
}
</script>
